<?php
/**
 * Created by PhpStorm.
 * User: ly
 * Date: 2017\12\13 0013
 * Time: 15:45
 */

use yii\grid\GridView;
//use yii\bootstrap\Html;
use yii\helpers\Html;
use yii\helpers\Url;
use backend\assets\AppAsset;
use backend\controllers\DtActionFilter;
use yii\widgets\LinkPager;

$this->title = '资产包详情';
$this->registerCssFile('@web/css/index.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/mask.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/AssetPackageDetails.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/notEdit.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/paging.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/select2.min.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('@web/css/defaultTheme.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
$this->registerCssFile('/css/uploadExcelModal.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);

$this->registerCss('  
    .wrap > .container-fluid > .container{width: 100%; padding: 0; margin: 0; }
    .edit-tabs{top: 10px;}
    .container.content.content2{top: 0;}
    .wrap{margin: 0;}  
    .details-btns button{background : #fff;} 
    .navbar {border:none;}

    #projectListBase-container{width:1500px;}
    .projectList #projectListBase{ overflow-x: scroll;}
    .projectList #projectListBase table{width: 1500px; }
    .projectList #projectListBase table tr th,.projectList #projectListBase table tr td{border : none;}
    .projectList #projectListBase table tfoot tr td{height : 47px; padding : 0;}
    .projectList #projectListBase table tfoot tr td ul li label{margin-bottom : 0;}

    .projectList #projectListBase .table tr td:first-child,.projectList #projectListBase .table tr th:first-child {width: 4%; text-align : center;}
    .projectList #projectListBase .table tr td:nth-child(2),.projectList #projectListBase .table tr th:nth-child(2){width: 1%;}
    .projectList #projectListBase .table tr td:nth-child(3),.projectList #projectListBase .table tr th:nth-child(3){width: 7%;}
    .projectList #projectListBase .table tr td:nth-child(4),.projectList #projectListBase .table tr th:nth-child(4){width: 5%;}
    .projectList #projectListBase .table tr td:nth-child(5),.projectList #projectListBase .table tr th:nth-child(5){width: 8%;}
    .projectList #projectListBase .table tr td:nth-child(6),.projectList #projectListBase .table tr th:nth-child(6){width: 8%;}
    .projectList #projectListBase .table tr td:nth-child(7),.projectList #projectListBase .table tr th:nth-child(7){width: 6%;}
    .projectList #projectListBase .table tr td:nth-child(8),.projectList #projectListBase .table tr th:nth-child(8){width: 6%;}
    .projectList #projectListBase .table tr td:nth-child(9),.projectList #projectListBase .table tr th:nth-child(9){width: 7%;}
    .projectList #projectListBase .table tr td:nth-child(10),.projectList #projectListBase .table tr th:nth-child(10){width: 7%;}
    .projectList #projectListBase .table tr td:nth-child(11),.projectList #projectListBase .table tr th:nth-child(11){width: 4.8%;}
    .projectList #projectListBase .table tr td:nth-child(12),.projectList #projectListBase .table tr th:nth-child(12){width: 6.2%;}
    .projectList #projectListBase .table tr td:nth-child(13),.projectList #projectListBase .table tr th:nth-child(13){width: 6.2%;}
    .projectList #projectListBase .table tr td:nth-child(14),.projectList #projectListBase .table tr th:nth-child(14){width: 9%;}
    .projectList #projectListBase .table tr td:nth-child(15),.projectList #projectListBase .table tr th:nth-child(15){width: 7%;}
     .projectList #projectListBase .table tr td:nth-child(16),.projectList #projectListBase .table tr th:nth-child(16){width: 9%;}
    // .projectList #projectListBase .table  tfoot tr td{padding: 0 ; height : 60px;}

    .table-foot-ul{border-left:0; border-right : 0; border-bottom : none; margin-bottom : -15px;}


    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(1),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(1){width: 2%;text-align : right;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(2),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(2){width: 7%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(3),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(3){width: 6.5%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(4),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(4){width: 5%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(5),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(5){width: 9%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(6),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(6){width: 9%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(7),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(7){width: 6%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(8),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(8){width: 7.5%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(9),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(9){width: 7.5%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(10),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(10){width: 6.5%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(11),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(11){width: 4.8%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(12),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(12){width: 6.2%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(13),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(13){width: 11.7%;}
    // .projectList2 #projectListBase2 #myTable2 tr td:nth-child(14),.projectList2 #projectListBase2 #myTable2 tr th:nth-child(14){width: 9%;}
   

    // .projectList #projectListBase2 .table  tfoot tr td{padding: 0 ; height : 60px;}
    .projectList2 {margin-top : 40px;}
    .projectList2 #myTable2 input{background : #fff;}
    
    .toTop{position: fixed;  bottom: 7%; right: 2%; z-index: 99;}
    
    .uploadExcel{
        display: inline-block;
        width: 143px;
        padding: 6px 12px;
        background-color: #f3f9fe;
        border: 1px solid #bcdffb;
        border-radius: 4px;
        text-align: center;
        line-height: 1.42857143;
        font-weight: normal;
        font-size: 15px;
        color: #2194F1;
        cursor: pointer;
    }
    .uploadExcel img{
        margin-right: 10px;
        margin-top: 2px;
    }


');

AppAsset::addScript($this, '@web/js/packageLog.js');
AppAsset::addScript($this, '@web/js/uploadExcelModal.js');

$avatar = $data['avatar'];
$editFlag = $data['avatar']['editFlag'];
?>

<?php echo $this->render('header', ['data' => $data, 'isPlan' => $isPlan, 'editFlag' => $editFlag,'workflow_status'=>$workflow_status,'result'=>$result]); ?>

<!-- 一键置顶开始 -->
<div class="toTop">
    <img src="/image/common/clickTop.png">
</div>
<!-- 一键置顶结束 -->

<script type="text/javascript">
    // 一键置顶 点击
    $('.toTop').click(function() {
        $("html,body").animate({ scrollTop: 0 }, 100);
    });
</script>

<!-- 页内导航   开始-->
<div class="container edit-tabs">
    <div class="row">
        <ul class="edit-tabs-ul1">
            <li class="pull-left active edit-tabs-li1 jbqk" data-title="packageDetail">
                <!--                <a href="--><?php
                //                echo Url::toRoute(['package/detail-info', 'packageid' => $data['id']]);
                //                ?><!--">基本情况</a>-->
                基本情况
                <ul class="edit-tabs-ul2 " style="">
                    <li class="pull-left active" id="jbqk1-link"><a href="###">基本信息</a></li>
                    <li class="pull-left " id="jbqk2-link"><a href="###">转让信息</a></li>
                    <li class="pull-left " id="jbqk3-link"><a href="###">流转、前期处置及维护情况</a></li>
                    <li class="pull-left " id="jbqk4-link"><a href="###">项目清单</a></li>
                </ul>
            </li>
            <li class="pull-left edit-tabs-li1 jdpg">
                <a href="<?php
                echo Url::toRoute(['package/initiation', 'packageid' => $data['id']]);
                ?>">立项评估</a>
                <ul class="edit-tabs-ul2" style="display: none;">
                    <li class="pull-left active" id="jdpg1-link"><a href="###">立项信息</a></li>
                    <li class="pull-left " id="jdpg6-link"><a href="###">报价信息</a></li> <!-- unclick -->
                    <li class="pull-left " id="jdpg2-link"><a href="###">团队组成</a></li>
                    <li class="pull-left " id="jdpg3-link"><a href="###">工作计划</a></li>
                    <li class="pull-left " id="jdpg4-link"><a href="###">团队受益分配</a></li>
                    <li class="pull-left " id="jdpg5-link"><a href="###">其他</a></li>
                </ul>
            </li>
            <li class="pull-left edit-tabs-li1 shqk">
                <a href="<?php
                echo Url::toRoute(['package/audit-feedback', 'packageid' => $data['id']]);
                ?>">审核情况</a>
                <ul class="edit-tabs-ul2" style="display: none;">
                    <li class="pull-left active"><a href="###">审核状况</a></li>
                </ul>
            </li>
            <li class="pull-left edit-tabs-li1 czrz" data-title="packageLog">
                <a href="<?php
                echo Url::toRoute(['package/log', 'packageid' => $data['id']]);
                ?>">操作日志</a>
                <ul class="edit-tabs-ul2" style="display: none;">
                    <li class="pull-left active" id="czrz1-link"><a href="###">操作记录</a></li>
                    <li class="pull-left " id="czrz2-link"><a href="###">数据更新纪录</a></li>
                </ul>
            </li>
        </ul>
    </div>
</div>
<!-- 页内导航   结束-->

<!-- 主体部分 开始 -->
<div class="container-fluid AssetPackageDetails BasicInformation">
    <div class="container content content2">
        <!-- 基本情况 开始 -->
        <div class="row package_detail">
            <!-- 右侧边栏 -->
            <div class="content-right pull-right  col-md-12">
                <!-- 1. 基本信息一栏-->
                <div class="perfect-information row container-fluid mb10 pb40 clearfix" id="jbqk1">
                    <?php
                    echo $this->render('show-base-detail', ['data' => $data, 'editFlag' => $editFlag]);//资产包详细信息
                    ?>
                </div>
                <!-- 1.基本信息 结束 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
                <!-- 2.转让信息 开始 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
                <div class="Transfer-information container-fluid row mb10" id="jbqk2">
                    <?php
                    echo $this->render('show-transfer-detail', ['data' => $data, 'editFlag' => $editFlag]);//资产包转让信息
                    ?>
                </div>
                <!-- 2.转让信息 结束 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->

                <!-- 3.流转前期处置及维护情况    开始  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
                <div class="History-information maintenance row mb10" id="jbqk3">
                    <?php
                    echo $this->render('show-history-detail', ['data' => $data, 'editFlag' => $editFlag]);//资产包前期流转历史记录
                    ?>
                </div>
                <!-- 3.流转前期处置及维护情况      结束  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->

                <!-- 4.项目清单    开始  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
                <div class="projectList row projectList-notedit clearfix pb40" id="jbqk4">
                    <!-- 1.项目（保证类、混合类） -->
                    <input type="hidden" id="package_id" value="<?PHP echo $data['id']; ?>">
                    <div class="projectList1 clearfix">
                        <div class="perfect-logo clearfix">
                            <img src="/image/officeHall/uploadAssetPackage/wsxx.png" class="pull-left">
                            <span class="pull-left">项目清单</span>

                            <?php
                            if (DtActionFilter::checkProject('package_edit', $data['id'])) {
                                echo '<div  class="pull-right uploadExcel">
                                        <img src="/image/myAssetBag/upLoader.png" class="pull-left">
                                        <span class="pull-left">上传项目清单</span>
                                    </div>';
                            }
                            //echo Html::img('@web/image/projectDetails/edit.png', ['class' => 'editImg']);
                            ?>




                        </div>
                        <div class="perfect-logo  perfect-logo2 clearfix">
                            <span class="pull-left">1.项目（保证类、混合类)</span>
                        </div>
                        <div class="pull-left"><input type="text" placeholder="输入借款人关键字"  name="keyWordsHH" id="keyWordsHH" style="padding-left:10px;width: 200px;height: 26px;border: 1px solid rgb(226, 226, 226);"><input  type="button" value="查询" id="searchHH"  style="margin: 0 5px;width:50px;height: 25px!important;background: #2096f1;color: #FFFFFF;font-size: 14px;border-radius: 3px;border: 1px solid rgb(226, 226, 226);"></div>
                        <ul class="notedit-nav-ul notedit-nav-ul-guarantee clearfix">
                            <li class="pull-right" tabId="4">补充说明</li>
                            <li class="pull-right" tabId="3">价值评估</li>
                            <li class="pull-right" tabId="2">司法进展</li>
                            <li class="pull-right active" tabId="1">基本信息</li>
                        </ul>
                        <div class="table-responsive  table-responsive-notedit clearfix" id="projectListHH">
                            <?php
                            //show-detail-project-hh
                            echo $this->render('show-detail-project-hh', ['projectListHH' => $projectListHH, 'tabID' => '1', 'is_highlights' => '']);//基本信息
                            ?>
                        </div>

                        <!-- 表格结束 -->
                        <!-- 2.项目（抵押类） -->
                        <div class="projectList2 clearfix">
                            <div class="perfect-logo  perfect-logo2 clearfix">
                                <span class="pull-left">2.项目（抵押类）</span>
                            </div>
                            <ul class="notedit-nav-ul notedit-nav-ul-guaranty clearfix">
                                <li class="pull-right" tabId="7">回现评估</li>
                                <li class="pull-right" tabId="6">非抵押评估</li>
                                <li class="pull-right" tabId="5">抵押物价值评估</li>
                                <li class="pull-right" tabId="4">抵押查封</li>
                                <li class="pull-right" tabId="3">抵押物信息</li>
                                <li class="pull-right" tabId="2">司法进展</li>
                                <li class="pull-right active" tabId="1">基本信息</li>
                            </ul>
                            <div class="table-responsive  table-responsive-notedit clearfix" id="projectListDY">
                                <?php
                                echo $this->render('show-detail-project-dy', ['projectListDY' => $projectListDY ,'pagesDY'=>$pagesDY,'tabID' => '1', 'is_highlights' => '']);//抵押类项目列表 基本信息
//                                echo $this->render('dy2', ['projectListDY' => $projectListDY,'pagesDY'=>$pagesDY, 'tabID' => '1', 'is_highlights' => '']);//抵押类项目列表 基本信息
                                ?>
                            </div>
                            <!-- 表格结束 -->

                            <!-- 模态窗口  结束!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
                            <!-- 申请立项 -->
                            <div class="modal fade" id="AssetPackageEditing-approval" tabindex="-1" role="dialog"
                                 aria-labelledby="myModalLabel">
                        </div>
                        <!-- 申请立项 -->
                    </div>
                    <!-- 4.项目清单   结束  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 基本情况  结束 -->

<!--<input type="hidden" id="package_id" name="package_id" value="<?php /*echo $data['id']; */?>">-->
<!--<input type="hidden" id="log_pager" name="log_pager"-->
<!--       value="--><?php //echo \yii\helpers\Url::toRoute('package-log/page2', true); ?><!--">-->
<!--<input type="hidden" id="current_page" value="--><?php //echo $dataLog['page']; ?><!--">-->
<input type="hidden" id="base_url" value="<?php echo Yii::$app->request->hostInfo; ?>">
<?php echo $this->render('footer',['data'=>$data]); ?>

<!-- 上传项目清单 start -->
<input type="hidden" id="upload_package_id" value="<?php echo $data['id']; ?>" />
<?php echo $this->renderFile('@app/views/package/upload-excel-modal.php'); ?>
<!-- 上传项目清单 end -->
<?php
$js = <<<JS
$(function() {
    $('.uploadExcel').click(function(data) {
        if (package_id > 0) {
            $('#upload_excel_modal').trigger('click');
        }
    })                     
})
JS;
$this->registerJs($js);
?>

